package com.huluobo.base.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.huluobo.base.bean.OrderBean
import io.reactivex.Observable

/**
 *  Created by LC on 2024/7/1.
 */
@Dao
interface OrderDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertOrderInfo(orderBean: OrderBean)

    @Delete
    fun deleteOrderInfo(orderBean: OrderBean)

    @Query("delete from order_info")
    fun deleteAllOrderInfo(): Int

    @Update
    fun updateOrderInfo(orderBean: OrderBean)

    @Query("select * from order_info")
    fun queryOrderInfo(): Observable<List<OrderBean>>
}